import type { ReactElement } from 'react'
import type { NextPage } from 'next'
import Layout from '../components/layout'
import useUser from '../lib/useUser'

export default function Enterprises() {
  const { user } = useUser({
    redirectTo: '/login',
  })
  console.log(user)
  return (
    <div>
      <h2>企业版</h2>
      {user ? (
          <p>{user.login}</p>
        ) : <div>暂无数据</div>
      }
    </div>
  )
}

Enterprises.getLayout = function getLayout(page: ReactElement) {
  return (
    <Layout>
      {page}
    </Layout>
  )
}